#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QPushButton>
#include <QStackedWidget>
#include <vector>
#include <QLineEdit>
#include <QSettings>
#include <QTcpSocket>
class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private:
    void checkFile(const QString& directory, const QString& filename);


    int show_num=0;
    int hid_num=0;

    QTcpSocket* socket1;

    QSettings  *config;

    //主窗口
    QStackedWidget* StackedWidget;

    //初始界面
    QWidget *init_page;

    //设置界面
    QWidget *config_page;

    //按钮宽
    int button_W;

    //按钮高
    int button_H;

    //按钮数量
    int button_num;

    //按钮时实数量
    int button_nums=0;

    //上边距
    int Top_margin;

    //左边距
    int Left_margin;

    //上下间距
    int up_down_Spacing;

    //左右间距
    int Left_right_spacing;

private:
    void prameter_init();

    void UI_init();



    void Buttoninit(QPushButton* but,QString hover_img, QString pressed_img);

    std::vector<QPushButton*> But_vecors;

    std::vector<QLineEdit*> Line_vecors;


};
#endif // MAINWINDOW_H
